package MobileApplicationDeveloper.diagram.providers;

import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.ENamedElement;
import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.tooling.runtime.providers.DiagramElementTypeImages;
import org.eclipse.gmf.tooling.runtime.providers.DiagramElementTypes;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;

/**
 * @generated
 */
public class MobileApplicationDeveloperElementTypes {

	/**
	 * @generated
	 */
	private MobileApplicationDeveloperElementTypes() {
	}

	/**
	 * @generated
	 */
	private static Map<IElementType, ENamedElement> elements;

	/**
	 * @generated
	 */
	private static DiagramElementTypeImages elementTypeImages = new DiagramElementTypeImages(
			MobileApplicationDeveloper.diagram.part.MobileApplicationDeveloperDiagramEditorPlugin
					.getInstance().getItemProvidersAdapterFactory());

	/**
	 * @generated
	 */
	private static Set<IElementType> KNOWN_ELEMENT_TYPES;

	/**
	 * @generated
	 */
	public static final IElementType Container_1000 = getElementType("MobileApplicationDeveloper.diagram.Container_1000"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType Label_2001 = getElementType("MobileApplicationDeveloper.diagram.Label_2001"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType View_2002 = getElementType("MobileApplicationDeveloper.diagram.View_2002"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType AppMobile_2003 = getElementType("MobileApplicationDeveloper.diagram.AppMobile_2003"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType Input_2004 = getElementType("MobileApplicationDeveloper.diagram.Input_2004"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType List_2005 = getElementType("MobileApplicationDeveloper.diagram.List_2005"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType Setting_2006 = getElementType("MobileApplicationDeveloper.diagram.Setting_2006"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType Image_2007 = getElementType("MobileApplicationDeveloper.diagram.Image_2007"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType ViewViewEvents_4001 = getElementType("MobileApplicationDeveloper.diagram.ViewViewEvents_4001"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType AppMobileMainView_4002 = getElementType("MobileApplicationDeveloper.diagram.AppMobileMainView_4002"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType ComponentComponentEvents_4003 = getElementType("MobileApplicationDeveloper.diagram.ComponentComponentEvents_4003"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType ViewViewSetting_4004 = getElementType("MobileApplicationDeveloper.diagram.ViewViewSetting_4004"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType AppMobileAppSetting_4005 = getElementType("MobileApplicationDeveloper.diagram.AppMobileAppSetting_4005"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType ViewViewComponents_4006 = getElementType("MobileApplicationDeveloper.diagram.ViewViewComponents_4006"); //$NON-NLS-1$
	/**
	 * @generated
	 */
	public static final IElementType ViewNextViews_4007 = getElementType("MobileApplicationDeveloper.diagram.ViewNextViews_4007"); //$NON-NLS-1$

	/**
	 * @generated
	 */
	public static ImageDescriptor getImageDescriptor(ENamedElement element) {
		return elementTypeImages.getImageDescriptor(element);
	}

	/**
	 * @generated
	 */
	public static Image getImage(ENamedElement element) {
		return elementTypeImages.getImage(element);
	}

	/**
	 * @generated
	 */
	public static ImageDescriptor getImageDescriptor(IAdaptable hint) {
		return getImageDescriptor(getElement(hint));
	}

	/**
	 * @generated
	 */
	public static Image getImage(IAdaptable hint) {
		return getImage(getElement(hint));
	}

	/**
	 * Returns 'type' of the ecore object associated with the hint.
	 * 
	 * @generated
	 */
	public static ENamedElement getElement(IAdaptable hint) {
		Object type = hint.getAdapter(IElementType.class);
		if (elements == null) {
			elements = new IdentityHashMap<IElementType, ENamedElement>();

			elements.put(Container_1000,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getContainer());

			elements.put(Label_2001,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getLabel());

			elements.put(View_2002,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getView());

			elements.put(AppMobile_2003,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getAppMobile());

			elements.put(Input_2004,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getInput());

			elements.put(List_2005,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getList());

			elements.put(Setting_2006,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getSetting());

			elements.put(Image_2007,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getImage());

			elements.put(ViewViewEvents_4001,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getView_ViewEvents());

			elements.put(AppMobileMainView_4002,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getAppMobile_MainView());

			elements.put(ComponentComponentEvents_4003,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getComponent_ComponentEvents());

			elements.put(ViewViewSetting_4004,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getView_ViewSetting());

			elements.put(AppMobileAppSetting_4005,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getAppMobile_AppSetting());

			elements.put(ViewViewComponents_4006,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getView_ViewComponents());

			elements.put(ViewNextViews_4007,
					MobileApplicationDeveloper.model.ModelPackage.eINSTANCE
							.getView_NextViews());
		}
		return (ENamedElement) elements.get(type);
	}

	/**
	 * @generated
	 */
	private static IElementType getElementType(String id) {
		return ElementTypeRegistry.getInstance().getType(id);
	}

	/**
	 * @generated
	 */
	public static boolean isKnownElementType(IElementType elementType) {
		if (KNOWN_ELEMENT_TYPES == null) {
			KNOWN_ELEMENT_TYPES = new HashSet<IElementType>();
			KNOWN_ELEMENT_TYPES.add(Container_1000);
			KNOWN_ELEMENT_TYPES.add(Label_2001);
			KNOWN_ELEMENT_TYPES.add(View_2002);
			KNOWN_ELEMENT_TYPES.add(AppMobile_2003);
			KNOWN_ELEMENT_TYPES.add(Input_2004);
			KNOWN_ELEMENT_TYPES.add(List_2005);
			KNOWN_ELEMENT_TYPES.add(Setting_2006);
			KNOWN_ELEMENT_TYPES.add(Image_2007);
			KNOWN_ELEMENT_TYPES.add(ViewViewEvents_4001);
			KNOWN_ELEMENT_TYPES.add(AppMobileMainView_4002);
			KNOWN_ELEMENT_TYPES.add(ComponentComponentEvents_4003);
			KNOWN_ELEMENT_TYPES.add(ViewViewSetting_4004);
			KNOWN_ELEMENT_TYPES.add(AppMobileAppSetting_4005);
			KNOWN_ELEMENT_TYPES.add(ViewViewComponents_4006);
			KNOWN_ELEMENT_TYPES.add(ViewNextViews_4007);
		}
		return KNOWN_ELEMENT_TYPES.contains(elementType);
	}

	/**
	 * @generated
	 */
	public static IElementType getElementType(int visualID) {
		switch (visualID) {
		case MobileApplicationDeveloper.diagram.edit.parts.ContainerEditPart.VISUAL_ID:
			return Container_1000;
		case MobileApplicationDeveloper.diagram.edit.parts.LabelEditPart.VISUAL_ID:
			return Label_2001;
		case MobileApplicationDeveloper.diagram.edit.parts.ViewEditPart.VISUAL_ID:
			return View_2002;
		case MobileApplicationDeveloper.diagram.edit.parts.AppMobileEditPart.VISUAL_ID:
			return AppMobile_2003;
		case MobileApplicationDeveloper.diagram.edit.parts.InputEditPart.VISUAL_ID:
			return Input_2004;
		case MobileApplicationDeveloper.diagram.edit.parts.ListEditPart.VISUAL_ID:
			return List_2005;
		case MobileApplicationDeveloper.diagram.edit.parts.SettingEditPart.VISUAL_ID:
			return Setting_2006;
		case MobileApplicationDeveloper.diagram.edit.parts.ImageEditPart.VISUAL_ID:
			return Image_2007;
		case MobileApplicationDeveloper.diagram.edit.parts.ViewViewEventsEditPart.VISUAL_ID:
			return ViewViewEvents_4001;
		case MobileApplicationDeveloper.diagram.edit.parts.AppMobileMainViewEditPart.VISUAL_ID:
			return AppMobileMainView_4002;
		case MobileApplicationDeveloper.diagram.edit.parts.ComponentComponentEventsEditPart.VISUAL_ID:
			return ComponentComponentEvents_4003;
		case MobileApplicationDeveloper.diagram.edit.parts.ViewViewSettingEditPart.VISUAL_ID:
			return ViewViewSetting_4004;
		case MobileApplicationDeveloper.diagram.edit.parts.AppMobileAppSettingEditPart.VISUAL_ID:
			return AppMobileAppSetting_4005;
		case MobileApplicationDeveloper.diagram.edit.parts.ViewViewComponentsEditPart.VISUAL_ID:
			return ViewViewComponents_4006;
		case MobileApplicationDeveloper.diagram.edit.parts.ViewNextViewsEditPart.VISUAL_ID:
			return ViewNextViews_4007;
		}
		return null;
	}

	/**
	 * @generated
	 */
	public static final DiagramElementTypes TYPED_INSTANCE = new DiagramElementTypes(
			elementTypeImages) {

		/**
		 * @generated
		 */
		@Override
		public boolean isKnownElementType(IElementType elementType) {
			return MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
					.isKnownElementType(elementType);
		}

		/**
		 * @generated
		 */
		@Override
		public IElementType getElementTypeForVisualId(int visualID) {
			return MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
					.getElementType(visualID);
		}

		/**
		 * @generated
		 */
		@Override
		public ENamedElement getDefiningNamedElement(
				IAdaptable elementTypeAdapter) {
			return MobileApplicationDeveloper.diagram.providers.MobileApplicationDeveloperElementTypes
					.getElement(elementTypeAdapter);
		}
	};

}
